package com.sina.weibo;

import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import com.sina.weibo.models.Fan;
import com.sina.weibo.models.MBlog;
import com.sina.weibo.models.User;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class WeiboRemoteSerivcePoxy extends WeiboRemoteService.Stub
{
  private Context ctx;

  public WeiboRemoteSerivcePoxy(Context paramContext)
  {
    this.ctx = paramContext;
  }

  public boolean getAttentionList(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4, List<IBinder> paramList)
    throws RemoteException
  {
    try
    {
      RPCHelper localRPCHelper = RPCHelper.getInstance(this.ctx);
      User localUser = StaticInfo.mUser;
      String str = paramString;
      int i = paramInt1;
      int j = paramInt2;
      int k = paramInt3;
      int m = paramInt4;
      Object[] arrayOfObject = localRPCHelper.getAttentionList(localUser, 0, str, i, null, j, k, m);
      if (arrayOfObject != null)
      {
        Iterator localIterator = ((ArrayList)arrayOfObject[1]).iterator();
        while (true)
        {
          if (!localIterator.hasNext())
          {
            n = 1;
            return n;
          }
          Fan localFan = (Fan)n.next();
          WeiboRemoteFan localWeiboRemoteFan1 = new WeiboRemoteFan(localFan);
          List<IBinder> localList = paramList;
          WeiboRemoteFan localWeiboRemoteFan2 = localWeiboRemoteFan1;
          boolean bool = localList.add(localWeiboRemoteFan2);
        }
      }
    }
    catch (RPCHelper.HttpException localHttpException)
    {
      while (true)
        int n = 0;
    }
  }

  public boolean getHomeList(int paramInt1, int paramInt2, List<IBinder> paramList)
    throws RemoteException
  {
    if (paramInt2 > 0)
      switch (paramInt1)
      {
      default:
        paramInt1 = 240;
      case 128:
      case 176:
      case 240:
      case 320:
      case 690:
      }
    while (true)
    {
      try
      {
        RPCHelper localRPCHelper = RPCHelper.getInstance(this.ctx);
        User localUser1 = StaticInfo.mUser;
        Object[] arrayOfObject = localRPCHelper.getHomeBlogList(localUser1, paramInt1, null, paramInt2);
        if (arrayOfObject != null)
          continue;
        int i = Log.d("weibo", "objs is null!");
        int j = 0;
        return j;
        ArrayList localArrayList = (ArrayList)arrayOfObject[1];
        if (localArrayList != null)
          continue;
        int m = Log.d("weibo", "objs[1] is null!");
        j = 0;
        continue;
        Iterator localIterator = localArrayList.iterator();
        if (localIterator.hasNext())
          continue;
        if (localArrayList.size() <= 0)
          continue;
        String str = this.ctx.getCacheDir().getAbsolutePath();
        User localUser2 = StaticInfo.mUser;
        Utils.cleanHomeListFile(str, localUser2);
        User localUser3 = StaticInfo.mUser;
        Utils.saveHomeListFile(localArrayList, str, localUser3);
        Context localContext = this.ctx;
        Intent localIntent = new Intent("com.sina.weibo.intent.action.ACTION_HOME_LIST_UPDATE");
        localContext.sendBroadcast(localIntent);
        k = 1;
        continue;
        MBlog localMBlog = (MBlog)k.next();
        WeiboRemoteBlog localWeiboRemoteBlog = new WeiboRemoteBlog(localMBlog);
        boolean bool = paramList.add(localWeiboRemoteBlog);
        continue;
      }
      catch (RPCHelper.HttpException localHttpException)
      {
      }
      int k = 0;
    }
  }

  public boolean isLogged()
    throws RemoteException
  {
    return Utils.getLoginStatus();
  }

  public void login()
    throws RemoteException
  {
    Context localContext1 = this.ctx;
    Intent localIntent1 = new Intent();
    Context localContext2 = this.ctx.getApplicationContext();
    Intent localIntent2 = localIntent1.setClass(localContext2, MainTabActivity.class).addFlags(268435456);
    localContext1.startActivity(localIntent2);
  }

  public boolean loginBackground(String paramString1, String paramString2)
    throws RemoteException
  {
    Context localContext = this.ctx;
    return SwitchUser.Login(paramString1, paramString2, localContext);
  }

  public boolean postWeibo(String paramString)
    throws RemoteException
  {
    try
    {
      RPCHelper localRPCHelper = RPCHelper.getInstance(this.ctx);
      String str1 = StaticInfo.mUser.gsid;
      String str2 = StaticInfo.mUser.uid;
      boolean bool1 = localRPCHelper.postSimpleMBlog(str1, str2, paramString);
      bool2 = bool1;
      return bool2;
    }
    catch (RPCHelper.HttpException localHttpException)
    {
      while (true)
        boolean bool2 = false;
    }
  }

  public boolean postWeiboWithImage(String paramString1, String paramString2)
    throws RemoteException
  {
    try
    {
      RPCHelper localRPCHelper = RPCHelper.getInstance(this.ctx);
      String str1 = StaticInfo.mUser.gsid;
      String str2 = StaticInfo.mUser.uid;
      boolean bool1 = localRPCHelper.postSimpleMBlog(str1, str2, paramString1, paramString2);
      bool2 = bool1;
      return bool2;
    }
    catch (RPCHelper.HttpException localHttpException)
    {
      while (true)
        boolean bool2 = false;
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     com.sina.weibo.WeiboRemoteSerivcePoxy
 * JD-Core Version:    0.6.0
 */